import java.util.Arrays;
import java.util.Scanner;

/**
 * @author : niu niu
 * @version : 1.0.0
 * @date : 2022/10/10 21:10
 * 组队竞赛
 * 删除公共字符
 *
 */
public class Day1 {
    public static void main1(String[] args) {
        //队伍数量
        int n;
        Scanner scanner = new Scanner(System.in);
        n = scanner.nextInt();
        //纪录水平
        int[] arrays = new int[3 * n];
        //输入
        for (int i = 0; i < arrays.length; i++) {
            arrays[i] = scanner.nextInt();
        }
        //对其排序
        Arrays.sort(arrays);
        //求最大值
        long sum = 0;
        //5 2 8 5 1 5----1 2 5 5 5 8 --- 1 5 8/ 2 5 5 第一个和最后两个，每次取倒数第二个相加
        for (int i = 0; i < n; i++) {
            sum += arrays[arrays.length - 2 * (i + 1)];
        }
        System.out.println(sum);
    }

    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        String s1 = scanner.nextLine();
        String s2 = scanner.nextLine();
        StringBuilder sb = new StringBuilder();
        char[] ch = s1.toCharArray();
        for (int i = 0; i < ch.length; i++) {
            if (!s2.contains(String.valueOf(ch[i]))) {
                // System.out.print(ch[i]);
                sb.append(ch[i]);
            }
        }
        System.out.println(sb.toString());
    }
}

